package starblaze
{
	
  public final class StreamFormat 
  {
    
    public function get numAttributes():uint { return m_attributes.length; }
    public function getAttribute(index:uint):Attribute { return m_attributes[index]; }
    
    private var m_numBytes:uint = 0;
    public function get numBytes():uint { return m_numBytes; }
    
    public function StreamFormat(...attributes) 
    {
      if (attributes.length > 0)
      {
        m_attributes = new Vector.<Attribute>(attributes.length, true);
        for (var i:int = 0; i < attributes.length; +i)
        {
          var attribute:Attribute = attributes[i];
          m_attributes[i] = attribute;
          m_numBytes += attribute.numBytes;
        }
      }
      else
        m_attributes = new Vector.<Attribute>();
    }
    
    public function push(attribute:Attribute):StreamFormat
    {
      m_attributes.push(attribute);
      m_numBytes += attribute.numBytes;
      return this;
    }
    
    internal var m_attributes:Vector.<Attribute> = null;
    
  }

}
